package com.ruoyi.demo05;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @Author Husp
 * @Date 2023/12/10 18:26
 */
public class Server {

    public static final String USER_FILE_PATH = "ruoyi-javasepro\\src\\main\\resources\\user.properties";

    public static void main(String[] args) {
        //建立通信连接
        try {
            while (true) {
                ServerSocket server = new ServerSocket(8080);
                Socket socket = server.accept();
                //给服务端分配线程处理客户端
                new ServerReaderThread(socket).start();
            }
        } catch (IOException e) {
            throw new RuntimeException("服务器发生了异常，请稍后重试~");
        }
    }
}
